<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath+"admin" + "/"%>">    
    <title>图片编辑</title>
    <link rel="stylesheet" type="text/css" href="skin/css/base.css">
    <script type="text/javascript">
    	function changeState()
    	{
    		var obj = document.imgEditFM.status;
    		var selVal = obj.options[obj.selectedIndex].value;
    		document.imgEditFM.selIndex.value = selVal;	 		
    	}
    	
    	function doUpdate()
    	{
    		if(document.imgEditFM.selIndex.value == 255)
    		{
    			alert("请选择状态!");
    			return;
    		}
    		document.imgEditFM.submit();
    	}
    </script>
  </head>  
  <body leftmargin="8" topmargin="8" background='skin/images/allbg.gif'>
		<!--  内容列表   -->
		<form name="imgEditFM" action="<%=path%>/imageMgr.do" method="post">
			<input type="hidden" name="action_method" value="update">			
			<input type="hidden" name="imageId" value="${image.id}">
			<input type="hidden" name="selIndex" value="">
			<table width="98%" border="0" cellpadding="2" cellspacing="1"
				bgcolor="#D1DDAA" align="center" style="margin-top: 8px">
				<tr bgcolor="#E7E7E7">
					<td height="24" colspan="2" background="skin/images/tbg.gif">
						&nbsp;图片信息&nbsp;
					</td>
				</tr>
				<tr height="22">
					<td width="6%" bgcolor="#FAFAF1" align="right">
						ID
					</td>
					<td width="90%" bgcolor="#FFFFFF" onmousemove="javascript:this.bgColor='#FCFDEE';" onmouseout="javascript:this.bgColor='#FFFFFF';">
						${image.id}
					</td>
				</tr>
				<tr height="22">
					<td width="6%" bgcolor="#FAFAF1" align="right">
						图片名称
					</td>
					<td width="90%" bgcolor="#FFFFFF" onmousemove="javascript:this.bgColor='#FCFDEE';" onmouseout="javascript:this.bgColor='#FFFFFF';">
						<input type="text" name="imageName" size="50" value="${image.imageName}">
					</td>
				</tr>
				<tr height="22">
					<td width="6%" bgcolor="#FAFAF1" align="right">
						存放路径
					</td>
					<td width="90%" bgcolor="#FFFFFF" onmousemove="javascript:this.bgColor='#FCFDEE';" onmouseout="javascript:this.bgColor='#FFFFFF';">${image.imagePath}</td>
				</tr>
				<tr height="22">
					<td width="6%" bgcolor="#FAFAF1" align="right">
						备注
					</td>
					<td width="90%" bgcolor="#FFFFFF" onmousemove="javascript:this.bgColor='#FCFDEE';" onmouseout="javascript:this.bgColor='#FFFFFF';">
						<textarea name="remark" rows="5" cols="38">${image.remark}</textarea>						
					</td>					
				</tr>
				<tr height="22">
					<td width="6%" bgcolor="#FAFAF1" align="right">
						状态
					</td>
					<td width="90%" bgcolor="#FFFFFF" onmousemove="javascript:this.bgColor='#FCFDEE';" onmouseout="javascript:this.bgColor='#FFFFFF';">
						<select name="status" onchange="changeState()">
							<option value="255">-- 请选择 --</option>
							<option value="0" <c:if test="${image.status == 0 }"><%="selected"%></c:if>>停止浏览</option>
							<option value="1" <c:if test="${image.status == 1 }"><%="selected"%></c:if>>开放浏览</option>
						</select>
					</td>
				</tr>								
				
				<tr bgcolor="#FAFAF1">
					<td height="35" colspan="10">
						&nbsp;
						<input class="coolbg" type="button" value="更新" onclick="doUpdate()"/>					
					</td>
				</tr>			
			</table>
		</form>		
	</body>
</html>
